<?php
##--------------------------------------------------------GTPT
function GTPT($fld){
    if($_POST[$fld])
        return $_POST[$fld];
    if($_GET[$fld])
        return $_GET[$fld];
    return false;    
}
##--------------------------------------------------------ERROR
function ERROR($prompt){
    echo "<center style='font-size:12px; font-family:tahoma; color:red; ' >$prompt</center>";
    return false;    
}
##--------------------------------------------------------db_connect
function db(){
    if($db=  mysql_connect($GLOBALS['sqlhost'], $GLOBALS['sqluser'], $GLOBALS['sqlpass']))
        if(  mysql_select_db($GLOBALS['dtbname']) ) 
            return $db;
    echo "<br><br><br><br>".ERROR("Error in MySQL connection");
    die();
}
##--------------------------------------------------------GO
function GO( $URL , $TIME=0 ){
    if(!$URL)return false;
    echo " <script language=javascript1.2> ";
            if(!$TIME) echo "location.href='".$URL."' ; " ;
            if( $TIME) echo "setTimeout(\"location.href='".$URL."';\" , ".$TIME." ) ; ";    
    echo " </script> ";
    return true;
}
